package com.lingnan.tijian.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lingnan.tijian.domain.CheckItem;
import com.lingnan.tijian.domain.SetmealDetailed;
import com.lingnan.tijian.domain.vo.SetmealVO;
import com.lingnan.tijian.service.ICheckItemService;
import com.lingnan.tijian.service.ISetmealDetailedService;
import com.lingnan.tijian.utils.ThreadLocalUtil;
import com.lingnan.tijian.domain.Setmeal;
import com.lingnan.tijian.mapper.SetmealMapper;
import com.lingnan.tijian.service.ISetmealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 无Service业务层处理
 * 
 * @author manba
 * @date 2024-12-26
 */
@Service
public class SetmealServiceImpl extends ServiceImpl<SetmealMapper,Setmeal> implements ISetmealService
{
    @Autowired
    private SetmealMapper setmealMapper;

    @Autowired
    private ICheckItemService checkItemService;

    @Autowired
    private ISetmealDetailedService setmealDetailedService;

    @Override
    @Transactional
    public List<Setmeal> selectSetmealList() {
        Map<String, Object> map= ThreadLocalUtil.get();
        Integer sex = (Integer)map.get("sex");
        //1.根据性别查询套餐
        List<Setmeal> setmealList = lambdaQuery()
                .eq(Setmeal::getType, sex)
                .list();
        return setmealList;
    }
}
